<@master template="master/master-loan" title="修改贷款资料">

<div class="detailsBox">
	<form class="action-ajax-form" action="/o2oloanapply/updateloan"
		method="post">
		<div class="action-ajax-load"
			data-url="<@url value='/rloanstart/serviceView?loanapplyNo=${loanApplyFileEntity.loanapplyNo}' />">
			<p class="onload"></p>
		</div>
		<div class="openBox">
			<h3 class="mt20">
				<i class="jtIco"></i>贷款基本资料
			</h3>
			<div class="detaiTab">
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
					<tbody>
						<#if loanApplyFileEntity.continueLoanParenNo!="">
						<tr>
							<td width="15%" align="right" class="bg">上一笔贷款单号：</td>
							<td width="35%">${loanApplyFileEntity.continueLoanParenNo}</td>
							<#if loanApplyFileEntity.loanType=="BK">
							<td width="15%" align="right" class="bg">是否为续贷：</td>
							<td>是</td> </#if>
						</tr>
						</#if>
						<tr>
							<td width="15%" align="right" class="bg">贷款类型：</td>
							<td width="35%"><@select dataSouceType="OTO_LOAN_TYPE_SB"
								value="${loanApplyFileEntity.loanType}" renderonly="true"/> <input
								type="hidden" name="loanType" id="loanType"
								value="${loanApplyFileEntity.loanType}" />
							</td>
							<td width="15%" align="right" class="bg">信贷经理：</td>
							<td><@autocomplete url="/loanrest/likeOperator?name="
								name="operatorName" value="${loanApplyFileEntity.operatorName}"
								hideIdName="operatorNo"
								hideIdValue="${loanApplyFileEntity.operatorNo}"/>(联想) <span
								style="color: red;">*</span><span id="operatorNoErorr"
								style="color: red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">申请金额(元)：</td>
							<td><input type="text" name="loanaMount" id="loanaMount"
								onchange="checkInput('loanaMount')"
								class="tabInp inputNum action-valid-field"
								value="${loanApplyFileEntity.loanaMount}"> <span
								style="color: red;">*</span><span id="loanaMountErorr"
								style="color: red;"></span></td>
							<td width="15%" align="right" class="bg"
								title="1、自营模式：贷款由380金服平台自行获客，并由380金服平台对合作银行提供回购担保； 2、共享模式：贷款由各经办机构推荐获客，并由经办机构对合作银行提供回购担保； 3、推荐模式：贷款由各经办机构推荐获客，由380金服平台对合作银行提供回购担保，续贷不计入佣金模式，计入自营模式。">经营模式<span
								class=" wenhaoIco"></span>:
							</td>
							<td><@select dataSouceType="OPERATION_MODEL"
								onchange="changeSelect(this);" name="operationModel"
								id="operationModel"
								value="${loanApplyFileEntity.operationModel}" class="tabInp
								action-valid-field" /> <span style="color: red;">*</span> <span
								id="operationModel_ERROR" style="color: red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">申请期限：</td>
							<td><@select dataSouceType="OTOLOANTERM" name="loanTerm"
								value="${loanApplyFileEntity.loanTerm}" id="loanTerm"
								class="tabInp action-valid-field"/> <span style="color: red;">*</span>
								<span id="loanTerm_ERROR" style="color: red;"></span>
							</td>
							<td width="15%" align="right" class="bg">经办平台：</td>
							<td><span id="default_show" style="display: none;">
									<@autocomplete url="/loanrest/search?name=" name="ltdName"
									value="${loanApplyFileEntity.ltdCode}-${loanApplyFileEntity.ltdName}"
									hideIdName="ltd" hideIdValue="${loanApplyFileEntity.ltd}"/>(联想)
							</span> <span id="default_hidden" style="display: none;"> <input
									name="operationType" type="hidden" id="operationType">
									<@autocomplete url="/loanrest/search?operationName="
									name="ltdName1"
									value="${loanApplyFileEntity.ltdCode}-${loanApplyFileEntity.ltdName}"
									hideIdName="ltd1" hideIdValue="${loanApplyFileEntity.ltd}"
									style="width:200px;"/>(联想)
							</span> <span style="color: red;">*</span><span id="ltdErorr"
								style="color: red;"></span></td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">担保方式：</td>
							<td><@select dataSouceType="OTOGUARANTEEWAY"
								name="guarAnteeWay" id="guarAnteeWay"
								value="${loanApplyFileEntity.guarAnteeWay}" class="tabInp
								action-valid-field" /> <span style="color: red;">*</span> <span
								id="guarAnteeWay_ERROR" style="color: red;"></span>
							</td>
							<td width="15%" align="right" class="bg"
								title="推荐人仅限内部员工，如无推荐人填写自己名字。">内部推荐人<span
								class=" wenhaoIco"></span>:
							</td>
							<!--  /loanrest/referrer 所有EA人员    -->
							<td><@autocomplete url="/rbadloan/liquidate?name="
								name="referrerName" value="${loanApplyFileEntity.referrerName}"
								hideIdName="referrerNo"
								hideIdValue="${loanApplyFileEntity.referrerNo}"/>(联想) <span
								style="color: red;">*</span> <span id="referrerNoErorr"
								style="color: red;"></span>
							</td>
						</tr>
						<tr>
							<td width="15%" align="right" class="bg">还款方式：</td>
							<td><@select dataSouceType="OTOREPAYMENTWAY"
								name="repayMentway" id="repayMentway"
								value="${loanApplyFileEntity.repayMentway}" class="tabInp
								action-valid-field" /> <span style="color: red;">*</span> <span
								id="repayMentway_ERROR" style="color: red;"></span>
							</td> <#if loanApplyFileEntity.loanType=="BP"||loanApplyFileEntity.loanType=='BP_JX'||loanApplyFileEntity.loanType=='SG'||loanApplyFileEntity.loanType=='YC'||loanApplyFileEntity.loanType=='SC'>
							<td width="15%" align="right" class="bg">渠道名称：</td>
							<td><@autocomplete url="/rpartner/referrer?loanType=${loanApplyFileEntity.loanType}&partnerName="
								name="partnerName" value="${partnerName}" hideIdName="partnerId"
								hideIdValue="${loanApplyFileEntity.partnerId}"/>(联想)<span style="color: red;">*</span>
								<span id="repayMentway_ERROR" style="color: red;"></span>
							</td> </#if>
						</tr>
						<tr>
							<td align="right" class="bg">外部推荐方\人：</td>
							<td><input type="text" name="commiceRecommend"
								id="commiceRecommend"
								value="${loanApplyFileEntity.commiceRecommend}"></td> <#if
							loanApplyFileEntity.loanType == "BK" >
							<td width="15%" align="right" class="bg">SD客户名称:</td>
							<td><input type="text" class="easyui-combogrid"
								name="customerSdNoRead" id="customerSdNoRead"
								style="width: 250px;"
								value="${loanApplyFileEntity.customeRname}"></input> <span
								style="color: red;">*</span> 至少输入4个字才能联想 <input type="hidden"
								name="customerName" id="customerName" style="width: 250px;"
								value='${loanApplyFileEntity.customeRname}'></input> <input
								type="hidden" name="customerCode" id="customerCode"
								style="width: 250px;"
								value='${loanApplyFileEntity.customerCode}'></input> <input
								type="hidden" name="customerSdNo" id="customerSdNo"
								style="width: 250px;" value='${loanApplyFileEntity.customerNo}'></input>
							</td> </#if>
						</tr>
						<tr>
							<td align="right" class="bg">备注：</td>
							<td colspan="3"><textarea rows="4" name="remark" cols="80"
									style="resize: none;"
									onpropertychange="if(value.length>200) value=value.substr(0,200)">${loanApplyFileEntity.remark}</textarea>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<!-- 上传附件 begin -->
		<div class="openBox action-ajax-load"
			data-url="<@url value='/loanrest/findloan?loanapplyNo=${loanApplyFileEntity.loanapplyNo}'/>"
			id="file_uploader"></div>
		<!-- 上传附件 end -->
		<div class=" mtb20 tac">
			<p class="mb20">
				<span id="errorMassege" style="color: red;" class="fs18">${errorMassege}</span>
			</p>
			<input name="loanapplyNo" type="hidden"
				value="${loanApplyFileEntity.loanapplyNo}"> <input
				name="loanId" type="hidden" value="${basic.customerId}"> <input
				type="submit" class="btn_auto_30 btn_blue" value="保 存"> <a
				class="btn_auto_30 btn_blue ml20"
				href="<@url value='/oldo2olike/detail_oldlike/zx?loanapplyNo=${loanApplyFileEntity.loanapplyNo}'/>"
				target="_self">返回贷款详情</a>&nbsp;
		</div>
	</form>
</div>
<@js src="/widget/jquery/jquery-1.11.3.min.js"/><@jsRender/> <@css
href="/easyui/themes/default/easyui.css"/> <@css
href="/easyui/themes/icon.css"/> <@js
src="/easyui/jquery.easyui.min.js"/><@jsRender/>
<script type="text/javascript">
	$(function() {

		var item = false;

		$('#customerSdNoRead')
				.combogrid(
						{
							loadMsg : '数据加载中,请稍后...',
							panelWidth : 500,
							idField : 'cno',
							textField : 'cname',
							url : '/oaoro2odatasub/jsonword',
							method : 'get',
							rownumbers : true,//序号   
							collapsible : false,//是否可折叠的   
							columns : [ [ {
								field : 'cno',
								title : '流水号',
								width : 80
							}, {
								field : 'ccode',
								title : '客户sd号',
								width : 120
							}, {
								field : 'cname',
								title : '客户名简称',
								width : 150
							}, {
								field : 'cnames',
								title : '客户全称',
								width : 150
							} ] ],
							fitColumns : true,
							delay : 1100,
							keyHandler : {
								up : function() {
								},
								down : function() {
								},
								enter : function() {
								},
								query : function(q) {
									if (q || q.length > 3) {
										$('#customerSdNoRead')
												.combogrid("grid").datagrid(
														"reload", {
															'reloadname' : q
														});
										$('#customerSdNoRead').combogrid(
												"setValue", q);
										item = true;
									}
								}
							},
							onClickRow : function(rowIndex, rowData) {
								$("#customerName").val(rowData.cname);
								$("#customerCode").val(rowData.ccode);
								$("#customerSdNo").val(rowData.cno);
							},
							onLoadSuccess : function() {
							}
						});

		var operationModel = $("#operationModel").val();
		if (operationModel == 'ZY') {
			$("#default_show").hide();
			$("#default_hidden").show();
		} else {
			$("#default_show").show();
			$("#default_hidden").hide();
		}

	});

	function changeSelect(str) {
		var operation = str.value;
		if (operation == 'ZY') {
			$("#default_show").hide();
			$("#operationType").val("ZY");
			$("input[name='ltdName']").val("");
			$("input[name='ltd']").val("");
			$("#default_hidden").show();
		} else {
			$("#default_show").show();
			$("#operationType").val("");
			$("input[name='ltd1']").val("");
			$("input[name='ltdName1']").val("");
			$("#default_hidden").hide();
		}
	}
</script>
</@master>
